#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__author__ = "Administrator"
__name__="main"
__date__="2016/6/28"
__time__="16:46"
"""
import socket
def handle_request(client):
    buf = client.recv(1024)
    client.send("HTTP/1.1 200 OK\r\n\r\n")
    client.send("hello,world")

def main():
    sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
    sock.bind('localhost',8080)
    sock.listen(5) # 最大连接数
    while True:
        connection,address = sock.accept()
        handle_request(connection)
        connection.close()
if __name__ == '__main__':
    main()
